package com.jtech.together.mvp.presenter;

import android.content.Context;
import android.os.Bundle;

import com.jtech.together.mvp.contract.LocationContract;
import com.jtech.together.view.activity.LocationActivity;

/**
 * 位置选择
 * Created by wuxubaiyang on 2017/5/11.
 */
public class LocationPresenter implements LocationContract.Presenter {
    private Context context;
    private LocationContract.View view;
    private double[] location;
    private String title;
    private String describe;

    public LocationPresenter(Context context, LocationContract.View view, Bundle bundle) {
        this.context = context;
        this.view = view;
        //获取位置信息
        if (null != bundle) {
            this.location = bundle.getDoubleArray(LocationActivity.KEY_LOCATION);
            this.title = bundle.getString(LocationActivity.KEY_LOCATION_TITLE);
            this.describe = bundle.getString(LocationActivity.KEY_LOCATION_DESCRIBE);
        }
    }

    @Override
    public double[] getLocation() {
        return location;
    }

    @Override
    public String getLocationTitle() {
        return title;
    }

    @Override
    public String getLocationDescribe() {
        return describe;
    }
}